package com.example.demo.service.impl;

import com.example.demo.dao.IUserDao;
import com.example.demo.pojo.User;
import com.example.demo.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

@Transactional
@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private IUserDao IUserDao;

    @Override
    public User findByUid(Integer uid) {
        return IUserDao.findByUid(uid);
    }

    @Override
    public User save(User user) {
        return IUserDao.save(user);
    }

    @Override
    public User findByUsernameAndPassword(String username, String password) {
        return IUserDao.findByUsernameAndPassword(username,password);
    }
}
